<template>
  <div class="about">
  <h1>count{{count}}</h1>
  <button @click="changecount">改变count</button>
  
  </div>
</template>

<script lang="ts">
 import {defineComponent} from "vue"
export default defineComponent({
  name :"About",
 
});


</script>
<script lang="ts" setup>
import {ref, watch}from 'vue';

let count = ref(1)
const changecount=()=>{
  count.value++
};
watch(
  count,(nweValue,oldValue)=>{
console.log("count的监听", nweValue, oldValue);
  },{
    immediate:true
  }
)







</script>